#ifndef ENGINE_LOG_H
#define ENGINE_LOG_H
#include <apoget.h>
#include <fstream>

class POGET_API Log
{
	Log() {}
	Log(const Log&);
	Log& operator=(const Log&);
	static Log theInstance;
	bool quietMode;

	std::streambuf*	coutbuf;
	std::ofstream*	pLogBuffer;

	bool			isInitialized = false;

public:
	static Log&		getInstance		();
	bool			initialize		(const char* logFile = NULL, 
										std::ofstream*	logBuffer = NULL,
										bool quiet = true);
	bool			reDirect		(const char* logFile = NULL,
										std::ofstream*	logBuffer = NULL);
	bool			shutdown		();
	void			log				(	const char* message, 
										bool showTimeStamp = true);
};

#define gLogger Log::getInstance()
#define gLog Log::getInstance().log

#endif